package com.cskaoyan.mapper.systemmapper;

import com.cskaoyan.bean.systembean.Admin;
import com.cskaoyan.bean.systembean.AdminExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AdminMapper {
    long countByExample(AdminExample example);

    int deleteByExample(AdminExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Admin record);

    int insertSelective(Admin record);

    List<Admin> selectByExample(AdminExample example);

    Admin selectByPrimaryKey(Integer id);


    int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example);

    //管理员登录时更新最后登录时间和ip，可以使用updateByPrimaryKeySelective，
    // 传入admin对象，admin对象中只要有id，ip，time即可完成更新
    int updateByPrimaryKeySelective(Admin record);

    int updateByPrimaryKey(Admin record);

    String selectAvatarByUsername(String username);

    String selectRoleIdsByUsername(String username);

    String selectPasswordByUsername(String username);
}